<!DOCTYPE html>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>highlight_tads3.t</title>
<meta name="generator" content="KF5::SyntaxHighlighting - Definition (TADS 3) - Theme (Breeze Dark)"/>
</head><body style="background-color:#232629;color:#cfcfc2"><pre>
<span style="color:#7a7c7d;">// TADS3 Example File</span>
<span style="color:#7a7c7d;">// Source: https://www.tads.org/t3doc/doc/t3QuickStart.htm</span>

<span style="color:#27ae60;">#charset </span><span style="color:#f44f4f;">&quot;us-ascii&quot;</span>
<span style="color:#27ae60;">#include </span><span style="color:#f44f4f;">&lt;adv3.h&gt;</span>
<span style="color:#27ae60;">#include </span><span style="color:#f44f4f;">&lt;en_us.h&gt;</span>

versionInfo: GameID
    IFID = <span style="color:#f44f4f;">'558c20af-6559-477a-9f98-b7b4274cd304</span><span style="color:#f44f4f;">'</span>
    name = <span style="color:#f44f4f;">'The Best Burglar</span><span style="color:#f44f4f;">'</span>
    byline = <span style="color:#f44f4f;">'by Eric Eve</span><span style="color:#f44f4f;">'</span>
    htmlByline = <span style="color:#f44f4f;">'by </span><span style="color:#27ae60;font-style:italic;">&lt;a href=&quot;mailto:eric.eve@hmc.ox.ac.uk&quot;&gt;</span>
<span style="color:#f44f4f;">                  Eric Eve</span><span style="color:#27ae60;font-style:italic;">&lt;/a&gt;</span><span style="color:#f44f4f;">'</span>
    version = <span style="color:#f44f4f;">'3</span><span style="color:#f44f4f;">'</span>
    authorEmail = <span style="color:#f44f4f;">'Eric Eve </span><span style="color:#27ae60;font-style:italic;">&lt;eric.eve@hmc.ox.ac.uk&gt;</span><span style="color:#f44f4f;">'</span>
    desc = <span style="color:#f44f4f;">'You are the world</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">s best burglar faced with the greatest challenge</span>
<span style="color:#f44f4f;">        of your felonious career.</span><span style="color:#f44f4f;">'</span>
    htmlDesc = <span style="color:#f44f4f;">'You are the world</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">s best burglar faced with the greatest</span>
<span style="color:#f44f4f;">        challenge of your felonious career.</span><span style="color:#f44f4f;">'</span>
;

gameMain: GameMainDef
    <span style="color:#7a7c7d;">/* the initial player character is 'me' */</span>
    initialPlayerChar = me

    showIntro()
    {
        <span style="color:#f44f4f;">&quot;</span><span style="color:#27ae60;font-style:italic;">&lt;b&gt;</span><span style="color:#f44f4f;">The Best Burglar</span><span style="color:#27ae60;font-style:italic;">&lt;/b&gt;</span><span style="color:#3daee9;font-weight:bold;">\n</span><span style="color:#f44f4f;">Well, you've got this far. Now it's just a</span>
<span style="color:#f44f4f;">        quick nip inside the house and out again carrying the Orb of Ultimate</span>
<span style="color:#f44f4f;">        Satisfaction, an object that no burglar has ever managed to steal</span>
<span style="color:#f44f4f;">        before. If you can pull it off you're sure to win the Burglar of the</span>
<span style="color:#f44f4f;">        Year Award, putting you at the pinnacle of your profession.</span><span style="color:#3daee9;font-weight:bold;">\b</span><span style="color:#f44f4f;">&quot;</span>;
    }

    showGoodbye()
    {
        <span style="color:#f44f4f;">&quot;Thanks for playing! &quot;</span>;
    }
;

startRoom: OutdoorRoom <span style="color:#f44f4f;">'Driveway</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;The large red-brick Tudor house stands immediately to the north of this end</span>
<span style="color:#f44f4f;">    of the driveway, while the drive back to the road where you left your</span>
<span style="color:#f44f4f;">    getaway vehicle runs off though a belt of trees to the southwest.&quot;</span>

    roomFirstDesc = <span style="color:#f44f4f;">&quot;Here you are in the drive of Number 305 Erehwon Avenue,</span>
<span style="color:#f44f4f;">        with the great house you've come to burgle standing just before you to</span>
<span style="color:#f44f4f;">        the north. The drive back to the road where you left your getaway</span>
<span style="color:#f44f4f;">        vehicle runs off though a belt of trees to the southwest.&quot;</span>

    north = frontDoor
    <span style="font-weight:bold;">in</span> asExit(north)
    southwest = drive
;

+ me: Actor
    pcDesc = <span style="color:#f44f4f;">&quot;You're Alexis Lightfinger, burglar extraordinaire, the most</span>
<span style="color:#f44f4f;">        professional thief in the known universe; but you're on a job now, so</span>
<span style="color:#f44f4f;">        you don't have time for the narcissistic indulgence of admiring your own</span>
<span style="color:#f44f4f;">        appearance. You're far too professional not to have come fully prepared,</span>
<span style="color:#f44f4f;">        so there's no practical need to look yourself over again. &quot;</span>
;

++ Container <span style="color:#f44f4f;">'large white swag bag*bags</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'swag bag</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's a large white bag with </span><span style="color:#27ae60;font-style:italic;">&lt;q&gt;</span><span style="color:#f44f4f;">SWAG</span><span style="color:#27ae60;font-style:italic;">&lt;/q&gt;</span><span style="color:#f44f4f;"> printed on it in very large</span>
<span style="color:#f44f4f;">    letters. Everyone knows that no real burglar would ever carry such a thing,</span>
<span style="color:#f44f4f;">    so by carrying it you know no one will take you for a real burglar. Cunning,</span>
<span style="color:#f44f4f;">    eh? &quot;</span>
;

+ frontDoor: LockableWithKey, Door <span style="color:#f44f4f;">'solid oak front door*doors</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'front door</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;The lintel above the front door is carved with the date 1589, presumably</span>
<span style="color:#f44f4f;">    the date the house was built. The door itself is made of solid oak. &quot;</span>
    keyList = [brassKey]

    makeOpen(stat)
    {
        <span style="font-weight:bold;">inherited</span>(stat);
        <span style="font-weight:bold;">if</span>(stat)
            achievement.awardPointsOnce();
    }

    achievement: Achievement { +<span style="color:#f67400;">10</span> <span style="color:#f44f4f;">&quot;opening the front door&quot;</span> }

;

+ flowerPot: ComplexContainer <span style="color:#f44f4f;">'terracotta small flower flowerpot/pot*pots</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">'flower pot</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's a perfectly ordinary small terracota pot, though it looks like no</span>
<span style="color:#f44f4f;">    one's got round to putting a plant in it yet. &quot;</span>
    subContainer: ComplexComponent, Container { bulkCapacity = <span style="color:#f67400;">3</span>}
    subUnderside: ComplexComponent, Underside { }

    initSpecialDesc = <span style="color:#f44f4f;">&quot;A small flower pot rests on the ground not far from the</span>
<span style="color:#f44f4f;">        front door. &quot;</span>

    bulk = <span style="color:#f67400;">3</span>
    bulkCapacity = <span style="color:#f67400;">3</span>
;

++ brassKey: Hidden, Key <span style="color:#f44f4f;">'small brass key*keys</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'small brass key</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's an ordinary enough small brass key. &quot;</span>
    subLocation = &amp;subUnderside
;

+ Enterable -&gt; frontDoor <span style="color:#f44f4f;">'large red red-brick tudor house/mansion/front</span>
<span style="color:#f44f4f;">    *houses*buildings</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'house</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's a large red-brick Tudor house with mullioned windows, climbing</span>
<span style="color:#f44f4f;">    creepers and the date 1589 carved over the door. &quot;</span>
;

++ Component <span style="color:#f44f4f;">'(door) carved lintel</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'lintel</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;Its most noteworthy feature is the date 1589 carved into it. &quot;</span>
;

+ Decoration <span style="color:#f44f4f;">'mullioned windows</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'windows</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;They're architecturally attractive, no doubt, but not especially helpful to</span>
<span style="color:#f44f4f;">    burglars. &quot;</span>

    notImportantMsg = <span style="color:#f44f4f;">'It</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">s a matter of professional pride with you never to</span>
<span style="color:#f44f4f;">        mess with windows. </span><span style="color:#f44f4f;">'</span>
    isPlural = <span style="font-weight:bold;">true</span>
;

+ Decoration <span style="color:#f44f4f;">'green climbing ivy/creepers/creeper</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'creepers</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;The front of the house is festooned with green creepers -- ivy, perhaps,</span>
<span style="color:#f44f4f;">    but botany was never your strong point since in the main plants aren't</span>
<span style="color:#f44f4f;">    worth burgling. &quot;</span>

    notImportantMsg = <span style="color:#f44f4f;">'The creepers can</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">t help you burgle the house -- they</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">re</span>
<span style="color:#f44f4f;">        certainly not strong enough to climb and they</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">re certainly not worth</span>
<span style="color:#f44f4f;">        stealing -- so you may as well leave them alone. </span><span style="color:#f44f4f;">'</span>
    isPlural = <span style="font-weight:bold;">true</span>
;

+ drive: PathPassage <span style="color:#f44f4f;">'drive/path/avenue</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'drive</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;The drive leading back to the road runs off through a belt of trees to the</span>
<span style="color:#f44f4f;">    southwest. &quot;</span>

    dobjFor(TravelVia)
    {
        action()
        {
            <span style="color:#f44f4f;">&quot;You retrace your steps back to the road, where your trusty unmarked</span>
<span style="color:#f44f4f;">            burglarmobile is still parked, ready for your quick getaway. &quot;</span>;

            <span style="font-weight:bold;">if</span>(orb.isIn(me))
            {
                <span style="color:#f44f4f;">&quot;Congratulations! You have got away with the Orb of Ultimate</span>
<span style="color:#f44f4f;">                Satisfaction, a feat never before performed. As you slip the orb</span>
<span style="color:#f44f4f;">                onto the back seat of your car and climb into the driver's seat</span>
<span style="color:#f44f4f;">                you tell yourself that you're now absolutely certain to win</span>
<span style="color:#f44f4f;">                the Burglar of the Year Award!</span><span style="color:#3daee9;font-weight:bold;">\b</span><span style="color:#f44f4f;">&quot;</span>;

                achievement.awardPointsOnce();

                finishGameMsg(ftVictory, [finishOptionUndo,
                    finishOptionFullScore]);
            }
            <span style="font-weight:bold;">else</span>
            {
                <span style="color:#f44f4f;">&quot;It's a shame you didn't manage to steal the orb, though.</span>
<span style="color:#f44f4f;">                Without it you'll never win the Burglar of the Year Award</span>
<span style="color:#f44f4f;">                now.</span><span style="color:#3daee9;font-weight:bold;">\b</span><span style="color:#f44f4f;">&quot;</span>;

                finishGameMsg(ftFailure, [finishOptionUndo]);
            }
        }
    }

    okayRubMsg = <span style="color:#f44f4f;">'What -- all of it? That may take a while! </span><span style="color:#f44f4f;">'</span>
    achievement: Achievement { +<span style="color:#f67400;">10</span> <span style="color:#f44f4f;">&quot;getting away with the orb&quot;</span> }
;

+ Decoration <span style="color:#f44f4f;">'belt/trees</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'trees</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;The trees are in full leaf, which is good, because they hide what you're</span>
<span style="color:#f44f4f;">    doing from the road. &quot;</span>

    notImportantMsg = <span style="color:#f44f4f;">'The trees are doing a good job of hiding you from the</span>
<span style="color:#f44f4f;">        road, so you may as well leave them alone. It</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">s not as if they</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">re</span>
<span style="color:#f44f4f;">        something you could steal, after all. </span><span style="color:#f44f4f;">'</span>
;

hallway: Room <span style="color:#f44f4f;">'Hallway</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;This hall is or grand proportions but pretty bare. The front door lies to</span>
<span style="color:#f44f4f;">    the south and other exits lead east, north and west. &quot;</span>

    south = hallDoor
    out asExit(south)
    west = study
    north: FakeConnector { <span style="color:#f44f4f;">&quot;You're pretty sure that only leads to the kitchen,</span>
<span style="color:#f44f4f;">        and you haven't come here to cook a meal. &quot;</span> }

    east: DeadEndConnector { <span style="color:#f44f4f;">'the living room</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">&quot;You </span><span style="color:#27aeae;font-style:italic;">&lt;&lt;one of&gt;&gt;</span><span style="color:#f44f4f;">walk through the</span>
<span style="color:#f44f4f;">        doorway and find yourself in</span><span style="color:#27aeae;font-style:italic;">&lt;&lt;or&gt;&gt;</span><span style="color:#f44f4f;">return to</span><span style="color:#27aeae;font-style:italic;">&lt;&lt;stopping&gt;&gt;</span><span style="color:#f44f4f;"> the living room</span>
<span style="color:#f44f4f;">        where you take </span><span style="color:#27aeae;font-style:italic;">&lt;&lt;one of&gt;&gt;</span><span style="color:#f44f4f;"> a </span><span style="color:#27aeae;font-style:italic;">&lt;&lt;or&gt;&gt;</span><span style="color:#f44f4f;">another</span><span style="color:#27aeae;font-style:italic;">&lt;&lt;stopping&gt;&gt;</span><span style="color:#f44f4f;"> quick look around,</span>
<span style="color:#f44f4f;">        but </span><span style="color:#27aeae;font-style:italic;">&lt;&lt;one of&gt;&gt;&lt;&lt;or&gt;&gt;</span><span style="color:#f44f4f;"> once again</span><span style="color:#27aeae;font-style:italic;">&lt;&lt;stopping&gt;&gt;</span><span style="color:#f44f4f;"> failing to find anything of</span>
<span style="color:#f44f4f;">        interest you quickly return to the hall. &quot;</span>}
;

+ hallDoor: Lockable, Door -&gt; frontDoor <span style="color:#f44f4f;">'front door*doors</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'front door</span><span style="color:#f44f4f;">'</span>
;

+ table:Surface <span style="color:#f44f4f;">'small wooden mahogany side table/legs*tables</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'small table</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's a small mahogany table standing on four thin legs. &quot;</span>
    initSpecialDesc = <span style="color:#f44f4f;">&quot;A small table rests by the east wall. &quot;</span>
    bulk = <span style="color:#f67400;">5</span>

    dobjFor(Take)
    {
        check()
        {
            <span style="font-weight:bold;">if</span>(contents.length &gt; <span style="color:#f67400;">0</span>)
                failCheck(<span style="color:#f44f4f;">'It</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">s probably not a very good idea to try picking</span>
<span style="color:#f44f4f;">                    up the table while </span><span style="color:#27ae60;font-style:italic;">&lt;&lt;contents[1].nameIs&gt;</span><span style="color:#f44f4f;">&gt; still on it. </span><span style="color:#f44f4f;">'</span>);
        }
    }
;

++ vase: Container <span style="color:#f44f4f;">'cheap china floral vase/pattern</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'vase</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's only a cheap thing, made of china but painted in a tasteless floral</span>
<span style="color:#f44f4f;">    pattern using far too many primary colours. &quot;</span>

    bulk = <span style="color:#f67400;">3</span>
    bulkCapacity = <span style="color:#f67400;">3</span>
;

+++ silverKey: Hidden, Key <span style="color:#f44f4f;">'small silver key*keys</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'small silver key</span><span style="color:#f44f4f;">'</span>
;

study: Room <span style="color:#f44f4f;">'Study</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;This study is much as you would expect: somewhat spartan. A desk stands in</span>
<span style="color:#f44f4f;">    the middle of the room with a chair placed just behind it. A </span><span style="color:#27aeae;font-style:italic;">&lt;&lt;if</span>
<span style="color:#27aeae;font-style:italic;">      picture.moved&gt;&gt;</span><span style="color:#f44f4f;">safe is built into </span><span style="color:#27aeae;font-style:italic;">&lt;&lt;else&gt;&gt;</span><span style="color:#f44f4f;"> rather bland painting hangs on</span>
<span style="color:#f44f4f;">    </span><span style="color:#27aeae;font-style:italic;">&lt;&lt;end&gt;&gt;</span><span style="color:#f44f4f;"> the west wall. The way out is to the east. &quot;</span>
    east = hallway
    out asExit(east)
;

+ desk: Heavy, Platform <span style="color:#f44f4f;">'plain wooden desk</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'desk</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's a plain wooden desk with a single drawer. &quot;</span>
    dobjFor(Open) remapTo(Open, drawer)
    dobjFor(Close) remapTo(Close, drawer)
    dobjFor(LookIn) remapTo(LookIn, drawer)
    dobjFor(UnlockWith) remapTo(UnlockWith, drawer, IndirectObject)
    dobjFor(LockWith) remapTo(LockWith, drawer, IndirectObject)
    dobjFor(Lock) remapTo(Lock, drawer)
    dobjFor(Unlock) remapTo(Unlock, drawer)
;

++ drawer: KeyedContainer, Component <span style="color:#f44f4f;">'(desk) drawer*drawers</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'drawer</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's an ordinary desk drawer with a small silver lock. &quot;</span>
    keyList = [silverKey]
;

+++ notebook: Readable <span style="color:#f44f4f;">'small bright red notebook/book/cover/pages</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">'small red notebook</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's a small notebook with a bright red cover. &quot;</span>

    readDesc = <span style="color:#f44f4f;">&quot;You open the notebook and flick through its pages. The only</span>
<span style="color:#f44f4f;">        thing you find of any interest is a page with </span><span style="color:#27ae60;font-style:italic;">&lt;q&gt;</span><span style="color:#f44f4f;">SAFE DATE</span><span style="color:#27ae60;font-style:italic;">&lt;/q&gt;</span><span style="color:#f44f4f;"> scrawled</span>
<span style="color:#f44f4f;">        across it. After satisfying yourself that the notebook contains nothing</span>
<span style="color:#f44f4f;">        else of any potential relevance you snap it shut again. </span><span style="color:#27ae60;font-style:italic;">&lt;.reveal</span>
<span style="color:#27ae60;font-style:italic;">        safe-date&gt;</span><span style="color:#f44f4f;">&quot;</span>

    dobjFor(Open) asDobjFor(Read)
    dobjFor(LookIn) asDobjFor(Read)

    dobjFor(Read)
    {
        action()
        {
            <span style="font-weight:bold;">inherited</span>;
            achievement.awardPointsOnce();
        }
    }

    cannotCloseMsg = <span style="color:#f44f4f;">'It</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">s already closed. </span><span style="color:#f44f4f;">'</span>
    achievement: Achievement { +<span style="color:#f67400;">5</span> <span style="color:#f44f4f;">&quot;reading the notebook&quot;</span> }
;

+ CustomImmovable, Chair <span style="color:#f44f4f;">'red office swivel chair</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'chair</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's a typical office swivel chair, covered in red fabric. &quot;</span>

    cannotTakeMsg = <span style="color:#f44f4f;">'You see no reason to burden yourself with such a useless</span>
<span style="color:#f44f4f;">        object; that would be quite unprofessional. </span><span style="color:#f44f4f;">'</span>

;

+ picture: RoomPartItem, Thing <span style="color:#f44f4f;">'rather bland picture/painting/landscape</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">'picture</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's a landscape, pleasantly executed enough, but of no great distinction</span>
<span style="color:#f44f4f;">    and definitely not worth the bother of stealing. &quot;</span>

    initNominalRoomPartLocation = defaultWestWall
    initSpecialDesc = <span style="color:#f44f4f;">&quot;A rather bland painting hangs on the west wall. &quot;</span>
    isListed = (moved)

    bulk = <span style="color:#f67400;">8</span>

    dobjFor(LookBehind)
    {
        action()
        {
            <span style="font-weight:bold;">if</span>(moved)
                <span style="font-weight:bold;">inherited</span>;
            <span style="font-weight:bold;">else</span>
            {
                safe.discover();
                <span style="color:#f44f4f;">&quot;Behind the picture is a safe built into the wall. &quot;</span>;
            }
        }
    }

    moveInto(newDest)
    {
        <span style="font-weight:bold;">if</span>(!safe.discovered)
        {
            <span style="color:#f44f4f;">&quot;Removing the painting from the wall reveals a safe behind. &quot;</span>;
            safe.discover();
        }
        <span style="font-weight:bold;">inherited</span>(newDest);
    }
;

+ safe: RoomPartItem, Hidden, CustomFixture, ComplexContainer
    <span style="color:#f44f4f;">'sturdy steel safe</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'safe</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It's a sturdy steel safe with a single dial on its door. &quot;</span>

    subContainer: ComplexComponent, IndirectLockable, OpenableContainer
    {
        bulkCapacity = <span style="color:#f67400;">5</span>
        makeOpen(stat)
        {
            <span style="font-weight:bold;">inherited</span>(stat);
            <span style="font-weight:bold;">if</span>(stat)
                achievement.awardPointsOnce();
        }

        achievement: Achievement { +<span style="color:#f67400;">10</span> <span style="color:#f44f4f;">&quot;opening the safe&quot;</span> }
    }

    specialDesc = <span style="color:#f44f4f;">&quot;A safe is built into the west wall. &quot;</span>
    specialNominalRoomPartLocation = defaultWestWall
    cannotTakeMsg = <span style="color:#f44f4f;">'It</span><span style="color:#f44f4f;">'</span>s firmly built into the wall; you can<span style="color:#f44f4f;">'t budge it. </span><span style="color:#f44f4f;">'</span>

    discover()
    {
        <span style="font-weight:bold;">if</span>(!discovered)
        {
            <span style="font-weight:bold;">foreach</span>(<span style="font-weight:bold;">local</span> cur <span style="font-weight:bold;">in</span> allContents)
                cur.discover();

            achievement.awardPointsOnce();
        }
        <span style="font-weight:bold;">inherited</span>();
    }

    achievement: Achievement { +<span style="color:#f67400;">5</span> <span style="color:#f44f4f;">&quot;finding the safe&quot;</span> }
;

++ safeDoor:  Hidden, ContainerDoor <span style="color:#f44f4f;">'(safe) door</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'safe door</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It has a circular dial attached to its centre. &quot;</span>
;

+++ safeDial: Hidden, Component,  NumberedDial <span style="color:#f44f4f;">'circular dial*dials</span><span style="color:#f44f4f;">'</span> <span style="color:#f44f4f;">'dial</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;The dial can be turned to any number between </span><span style="color:#27aeae;font-style:italic;">&lt;&lt;minSetting&gt;&gt;</span><span style="color:#f44f4f;"> and</span>
<span style="color:#f44f4f;">    </span><span style="color:#27aeae;font-style:italic;">&lt;&lt;maxSetting&gt;&gt;</span><span style="color:#f44f4f;">. It's currently at </span><span style="color:#27aeae;font-style:italic;">&lt;&lt;curSetting&gt;&gt;</span><span style="color:#f44f4f;">. &quot;</span>

    minSetting = <span style="color:#f67400;">0</span>
    maxSetting = <span style="color:#f67400;">99</span>
    curSetting = <span style="color:#f44f4f;">'35</span><span style="color:#f44f4f;">'</span>

    num1 = <span style="color:#f67400;">0</span>
    num2 = <span style="color:#f67400;">0</span>
    correctCombination = <span style="color:#f67400;">1589</span>

    makeSetting(val)
    {
        <span style="font-weight:bold;">inherited</span>(val);
        num2 = num1;
        num1 = toInteger(val);
        <span style="font-weight:bold;">if</span>(<span style="color:#f67400;">100</span> * num2 + num1 == correctCombination)
        {
            <span style="color:#f44f4f;">&quot;You hear a slight </span><span style="color:#27ae60;font-style:italic;">&lt;i&gt;</span><span style="color:#f44f4f;">click</span><span style="color:#27ae60;font-style:italic;">&lt;/i&gt;</span><span style="color:#f44f4f;"> come from the safe door. &quot;</span>;
            safe.makeLocked(<span style="font-weight:bold;">nil</span>);
        }
        <span style="font-weight:bold;">else</span> <span style="font-weight:bold;">if</span>(!safe.isOpen)
            safe.makeLocked(<span style="font-weight:bold;">true</span>);
    }
;

++ orb: Thing <span style="color:#f44f4f;">'ultimate battered dull metal orb/sphere/ball/satisfaction</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">'Orb of Ultimate Satisfaction</span><span style="color:#f44f4f;">'</span>
    <span style="color:#f44f4f;">&quot;It doesn't look much be honest, just a battered sphere made of some dull</span>
<span style="color:#f44f4f;">    metal, but you've been told it's the most valuable and desirable object</span>
<span style="color:#f44f4f;">    in the known universe! &quot;</span>

    aName = (theName)

    subLocation = &amp;subContainer

    okayRubMsg = <span style="color:#f44f4f;">'As {you/he} rub{s} {the dobj/him} a shimmering djiin suddenly</span>
<span style="color:#f44f4f;">        appears in the air before you!</span><span style="color:#3daee9;font-weight:bold;">\b</span>
<span style="color:#f44f4f;">        </span><span style="color:#27ae60;font-style:italic;">&lt;q&gt;</span><span style="color:#f44f4f;">Hello, you have reached the automated holographic answering service</span>
<span style="color:#f44f4f;">        of Jeannie the Genie,</span><span style="color:#27ae60;font-style:italic;">&lt;/q&gt;</span><span style="color:#f44f4f;"> she announces. </span><span style="color:#27ae60;font-style:italic;">&lt;q&gt;</span><span style="color:#f44f4f;">I</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">m sorry I</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">m not</span>
<span style="color:#f44f4f;">        available to respond to your rub in person right now, but my hours of</span>
<span style="color:#f44f4f;">        activity have been heavily curtailed by the European Working Time</span>
<span style="color:#f44f4f;">        Directive. Before making a wish, please make sure that you have</span>
<span style="color:#f44f4f;">        conducted a full risk assessment in line with the latest Health and</span>
<span style="color:#f44f4f;">        Safety Guidelines. Also, please note that before any wish can be granted</span>
<span style="color:#f44f4f;">        you must sign a Form P45/PDQ/LOL indemnifying this wish-granting agency</span>
<span style="color:#f44f4f;">        against any consequential loss or damage arising from the fulfilment of</span>
<span style="color:#f44f4f;">        your desires. Thank you for rubbing. Have a nice day!</span><span style="color:#27ae60;font-style:italic;">&lt;/q&gt;</span><span style="color:#3daee9;font-weight:bold;">\b</span>
<span style="color:#f44f4f;">        Her message complete, the holographic djiin fades away into</span>
<span style="color:#f44f4f;">        non-existence. </span><span style="color:#f44f4f;">'</span>

    moveInto(dest)
    {
        <span style="font-weight:bold;">inherited</span>(dest);
        <span style="font-weight:bold;">if</span>(dest.isOrIsIn(me))
            achievement.awardPointsOnce();
    }

    achievement: Achievement { +<span style="color:#f67400;">10</span> <span style="color:#f44f4f;">&quot;taking the orb&quot;</span> }
;

<span style="color:#7a7c7d;">//------------------------------------------------------------------------------</span>

<span style="color:#7a7c7d;">/* DEFINE A NEW VERB */</span>

DefineTAction(Rub)
;

VerbRule(Rub)
    <span style="color:#f44f4f;">'rub</span><span style="color:#f44f4f;">'</span> dobjList
    : RubAction
    verbPhrase = <span style="color:#f44f4f;">'rub/rubbing (what)</span><span style="color:#f44f4f;">'</span>
;

<span style="color:#7a7c7d;">/* When creating a new verb, you'll want to modify the Thing class so as to provide</span>
<span style="color:#7a7c7d;">   default handling for the command. The defaults specified here will be used except</span>
<span style="color:#7a7c7d;">   on objects for which you define explicit handling of the command. */</span>

<span style="font-weight:bold;">modify</span> Thing
    dobjFor(Rub)
    {
        preCond = [touchObj]
        action() { mainReport(okayRubMsg); }
    }

    okayRubMsg = <span style="color:#f44f4f;">'{You/he} rub{s} {the dobj/him} but not much happens as a</span>
<span style="color:#f44f4f;">        result. </span><span style="color:#f44f4f;">'</span>

    shouldNotBreakMsg = <span style="color:#f44f4f;">'Only amateurs go round breaking things unnecessarily. </span><span style="color:#f44f4f;">'</span>
;

<span style="color:#7a7c7d;">//------------------------------------------------------------------------------</span>

<span style="color:#7a7c7d;">/* HINTS */</span>

TopHintMenu;

+ Goal -&gt; (frontDoor.achievement)
    <span style="color:#f44f4f;">'How do I get into the house?</span><span style="color:#f44f4f;">'</span>
    [
        <span style="color:#f44f4f;">'Well, the windows don</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">t seem a good way in. </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'So perhaps you</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">d better try the front door. </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Could someone have left a key around somewhere? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Is there anything lying around where someone could have hidden a key? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'What about that flowerpot? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Try looking under the flowerpot. </span><span style="color:#f44f4f;">'</span>
    ]

    goalState = OpenGoal
;

<span style="color:#7a7c7d;">/* The closeWhenSeen property of the following Goal object is an example of how to</span>
<span style="color:#7a7c7d;">   make your hint menu respond dynamically to the player's current situation. */</span>

+ Goal <span style="color:#f44f4f;">'Where can I find the orb? </span><span style="color:#f44f4f;">'</span>
    [
        <span style="color:#f44f4f;">'Something like that is bound to be kept safe. </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'So it</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">s probably inside the house. </span><span style="color:#f44f4f;">'</span>
    ]

    goalState = OpenGoal
    closeWhenSeen = hallway
;

+ Goal <span style="color:#f44f4f;">'Where can I find the orb?</span><span style="color:#f44f4f;">'</span>
    [
        <span style="color:#f44f4f;">'It</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">s sure to be kept somewhere safe. </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'You</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">d better hunt around. </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Somewhere in the study seems the most likely place. </span><span style="color:#f44f4f;">'</span>,
        deskHint,
        <span style="color:#f44f4f;">'But it should be safely locked in a safe </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Where might someone hide a safe in this study? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'What could be behind that picture on the wall? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Try looking behind the picture (or simply taking the picture). </span><span style="color:#f44f4f;">'</span>
    ]

    openWhenSeen = hallway
    closeWhenSeen = orb
;

++ deskHint: Hint <span style="color:#f44f4f;">'Have you tried looking in the desk drawer? </span><span style="color:#f44f4f;">'</span>
    [deskGoal]
;

+ deskGoal: Goal <span style="color:#f44f4f;">'How do I get the desk drawer open?</span><span style="color:#f44f4f;">'</span>
    [
        <span style="color:#f44f4f;">'Have you examined the drawer? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'What might you need to unlock it? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Where might you find such a thing? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'What have you seen that a small key might be hidden in? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'How carefully have you searched the hall? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'What is (or was) on the hall table? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'What might that vase be for? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Try looking in the vase. </span><span style="color:#f44f4f;">'</span>
    ]
    closeWhenSeen = notebook
;

+ Goal <span style="color:#f44f4f;">'How do I get the safe open?</span><span style="color:#f44f4f;">'</span>
    [
        <span style="color:#f44f4f;">'How carefully have you examined the safe? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Where might someone leave a clue to the combination? </span><span style="color:#f44f4f;">'</span>,
        deskHint,
        <span style="color:#f44f4f;">'Make sure you read the notebook. </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Once you</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">ve found the combination you need to use the dial. </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'If the combination is a number larger than 99 you</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">ll need to enter it</span>
<span style="color:#f44f4f;">        in stages. </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'For example, if the combination were 1234 you</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">d first need to turn the</span>
<span style="color:#f44f4f;">        dial to 12 and then turn it to 34. </span><span style="color:#f44f4f;">'</span>
    ]

    openWhenSeen = safe
    closeWhenAchieved = (safe.subContainer.achievement)
;

+ Goal <span style="color:#f44f4f;">'What does the clue in the notebook mean?</span><span style="color:#f44f4f;">'</span>
    [
        <span style="color:#f44f4f;">'Well, </span><span style="color:#27ae60;font-style:italic;">&lt;q&gt;</span><span style="color:#f44f4f;">SAFE</span><span style="color:#27ae60;font-style:italic;">&lt;/q&gt;</span><span style="color:#f44f4f;"> might refer to something you want to open. </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Have you seen a date round here? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'When was this house built? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Where might you find the year in which this house was built? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'How carefully have you looked at the front of the house? </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'Did you examine the door? </span><span style="color:#f44f4f;">'</span>
    ]

    openWhenRevealed = <span style="color:#f44f4f;">'safe-date</span><span style="color:#f44f4f;">'</span>
    closeWhenAchieved = (safe.subContainer.achievement)
;


+ Goal <span style="color:#f44f4f;">'What do I do with the orb now I</span><span style="color:#3daee9;font-weight:bold;">\'</span><span style="color:#f44f4f;">ve got it?</span><span style="color:#f44f4f;">'</span>
    [
        <span style="color:#f44f4f;">'Well, you could try rubbing it. </span><span style="color:#f44f4f;">'</span>,
        <span style="color:#f44f4f;">'But the main thing to do now is to escape with it. </span><span style="color:#f44f4f;">'</span>
    ]
    openWhenSeen = orb
;
</pre></body></html>
